home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / proctime.h.z / proctime.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  3.3 KB  |  105 lines

  1. /* $Id: proctime.h,v 1.15 1999/02/23 11:43:12 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_PROCTIME_H__
  25. #define __GLIBTOP_PROCTIME_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/cpu.h>
  29. #include <glibtop/global.h>
  30.  
  31. BEGIN_LIBGTOP_DECLS
  32.  
  33. #define GLIBTOP_PROC_TIME_START_TIME    0
  34. #define GLIBTOP_PROC_TIME_RTIME        1
  35. #define GLIBTOP_PROC_TIME_UTIME        2
  36. #define GLIBTOP_PROC_TIME_STIME        3
  37. #define GLIBTOP_PROC_TIME_CUTIME    4
  38. #define GLIBTOP_PROC_TIME_CSTIME    5
  39. #define GLIBTOP_PROC_TIME_TIMEOUT    6
  40. #define GLIBTOP_PROC_TIME_IT_REAL_VALUE    7
  41. #define GLIBTOP_PROC_TIME_FREQUENCY    8
  42. #define GLIBTOP_PROC_TIME_XCPU_UTIME    9
  43. #define GLIBTOP_PROC_TIME_XCPU_STIME    10
  44.  
  45. #define GLIBTOP_MAX_PROC_TIME        11
  46.  
  47. typedef struct _glibtop_proc_time    glibtop_proc_time;
  48.  
  49. /* Time section */
  50.  
  51. struct _glibtop_proc_time
  52. {
  53.     u_int64_t    flags,
  54.         start_time,    /* start time of process -- 
  55.                  * seconds since 1-1-70 */
  56.         rtime,        /* real time accumulated by process */
  57.         utime,        /* user-mode CPU time accumulated by process */
  58.         stime,        /* kernel-mode CPU time accumulated by process */
  59.         cutime,        /* cumulative utime of process and 
  60.                  * reaped children */
  61.         cstime,        /* cumulative stime of process and 
  62.                  * reaped children */
  63.         timeout,    /* The time (in jiffies) of the process's
  64.                  * next timeout */
  65.         it_real_value,    /* The time (in jiffies) before the
  66.                  * next SIGALRM is sent to the process
  67.                  * due to an interval timer. */
  68.         frequency,    /* Tick frequency. */
  69.         xcpu_utime [GLIBTOP_NCPU],    /* utime and stime for all CPUs on */
  70.         xcpu_stime [GLIBTOP_NCPU];    /* SMP machines. */
  71. };
  72.  
  73. #define glibtop_get_proc_time(p1, p2)    glibtop_get_proc_time_l(glibtop_global_server, p1, p2)
  74.  
  75. #if GLIBTOP_SUID_PROC_TIME
  76. #define glibtop_get_proc_time_r    glibtop_get_proc_time_p
  77. #else
  78. #define glibtop_get_proc_time_r    glibtop_get_proc_time_s
  79. #endif
  80.  
  81. void glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid);
  82.  
  83. #if GLIBTOP_SUID_PROC_TIME
  84. void glibtop_init_proc_time_p (glibtop *server);
  85. void glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid);
  86. #else
  87. void glibtop_init_proc_time_s (glibtop *server);
  88. void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
  89. #endif
  90.  
  91. #ifdef GLIBTOP_NAMES
  92.  
  93. /* You need to link with -lgtop_names to get this stuff here. */
  94.  
  95. extern const char *glibtop_names_proc_time [];
  96. extern const unsigned glibtop_types_proc_time [];
  97. extern const char *glibtop_labels_proc_time [];
  98. extern const char *glibtop_descriptions_proc_time [];
  99.  
  100. #endif
  101.  
  102. END_LIBGTOP_DECLS
  103.  
  104. #endif
  105.